
Type CEditor

	
	Field MainUI:CedUI

	Method Init()
	
	
		SetWorkDir()
		InitGUI()
		
		
		
	EndMethod

	Method InitGUI()
	
		MainUI = New CedUI
		MainUI.Init()	
	
	
	EndMethod
	
	Method SetWorkDir()

		WorkingDir = getenv_("USERPROFILE")+"\Documents\GenEd3D"
		If FileType(WorkingDir) = 0 Then
			Local cd:Byte = CreateDir(WorkingDir)
			If cd = False Then
				WorkingDir = RequestDir("Select Working Directory",getenv_("USERPROFILE")+"\Documents")
				If WorkingDir = "" Then
					Notify("A working directory is required!~nExiting")
					End
				EndIf
			EndIf	
		EndIf
		If FileType(WorkingDir+"\Models") = 0 Then CreateDir(WorkingDir+"\Models")
		If FileType(WorkingDir+"\Textures") = 0 Then CreateDir(WorkingDir+"\Textures")
		If FileType(WorkingDir+"\Maps") = 0 Then CreateDir(WorkingDir+"\Maps")
		If FileType(WorkingDir+"\Objects") = 0 Then CreateDir(WorkingDir+"\Objects")

	EndMethod

	Method OnEvent()
		WaitEvent()
		Local EID:Int = EventID()
		MainUI.Update(EID)
		
	EndMethod


	Method OnNewMap()

	


	EndMethod

EndType
